import * as THREE from 'three';
export function lanToCoord(e, t, a) {
  return [
    Math.cos((e / 180) * Math.PI) * Math.cos((t / 180) * Math.PI) * a,
    Math.sin((t / 180) * Math.PI) * a,
    -Math.sin((e / 180) * Math.PI) * Math.cos((t / 180) * Math.PI) * a
  ];
}
export function lanToVector3(e, t, a) {
  return new THREE.Vector3(
    Math.cos((e / 180) * Math.PI) * Math.cos((t / 180) * Math.PI) * a,
    Math.sin((t / 180) * Math.PI) * a,
    -Math.sin((e / 180) * Math.PI) * Math.cos((t / 180) * Math.PI) * a
  );
}
export function coordToLan(e, t, a) {
  return [
    (Math.atan2(e, -t) / Math.PI) * 180,
    (Math.atan2(a, Math.sqrt(e * e + t * t)) / Math.PI) * 180
  ];
}
